<?php 
/**
 * @version		$Id:  $
 * @package		Success Framework Mobile
 * @subpackage	Helper
 * @copyright	Copyright (C) 2007 - 2010 Success company - VietNam. All rights reserved.
 */
 // no direct access
defined( '_EXEC' ) or die( 'Restricted access' );

/**
* Application define
*/


date_default_timezone_set('Asia/Bangkok');

//Global definitions
define('PATH_BASE', dirname(__FILE__) );
session_start();
define( 'DS', DIRECTORY_SEPARATOR );
$parts = explode( DS, PATH_BASE );
define( 'PATH_ROOT', implode( DS, $parts ) );
define( 'PATH_SITE',   PATH_ROOT );
define( 'PATH_TMPL',   PATH_ROOT.DS.'tmpl'.DS);
define( 'PATH_LIB',   PATH_ROOT.DS.'lib'.DS);
define( 'PATH_CONTROLLER',   PATH_ROOT.DS.'controllers'.DS);
define( 'PATH_MODEL',   PATH_ROOT.DS.'models'.DS);
define( 'PATH_VIEW',   PATH_ROOT.DS.'views'.DS);
define( 'PATH_LANG',   PATH_ROOT.DS.'lang'.DS);

//Import lib
import(PATH_ROOT.DS.'ss_Config.php');

if(LANG=='en')
import(PATH_LANG.'en.php');
else if(LANG=='nl')
import(PATH_LANG.'nl.php');
else
import(PATH_LANG.'vi.php');


import(PATH_LIB.DS.'ss_Request.php');
import(PATH_LIB.'ss_Object.php');    
import(PATH_LIB.'ss_DBObject.php');
import(PATH_LIB.'ss_File.php');
import(PATH_LIB.'ss_View.php');
import(PATH_LIB.'ss_Router.php');
import(PATH_LIB.'ss_Template.php');
import(PATH_LIB.'ss_Controller.php');
import(PATH_LIB.'ss_Model.php');
import(PATH_LIB.'ss_Session.php');
import(PATH_LIB.'ss_User.php');
import(PATH_LIB.'ss_Main.php');
import(PATH_LIB.'ss_DateUtils.php');
import(PATH_LIB.'ss_NumberUtils.php');
import(PATH_LIB.'ss_HTML.php');


$template=new sscls_Template;
$template->index();

    /**
	 * Load file
	 */
    function load($path='')
    {
        if(fileexists($path))
           include($path);    
        else
           die('File '.$path.' not found!');
    }
    
    
    /**
	 * Import lib
	 */     
    function import($path='')
    {
        if(fileexists($path))
            require_once($path);    
        else
            die('File '.$path.' not found!');
    }
    
    /**
	 * Check file is exists
     * @return true if file is exitsts else is not exists
	 */
    function fileexists($path)
    {
        if(file_exists($path))
            return true;
        else
            return false;
    }
?>

